package com.spring.boot;

import com.spring.context.ConfigurableApplicationContext;
import com.spring.core.env.ConfigurableEnvironment;

import java.time.Duration;

/**
 * @author liyuncong
 * @version 1.0
 * @file SpringApplicationRunnerListener
 * @brief SpringApplicationRunnerListener
 * @details SpringApplicationRunnerListener
 * @date 2022-12-08
 *
 * Edit History
 * ----------------------------------------------------------------------------
 * DATE                        NAME               DESCRIPTION
 * 2022-12-08                  liyuncong          Created
 */
public interface SpringApplicationRunListener {

    default void starting(ConfigurableBootstrapContext bootstrapContext) {
    }

    default void environmentPrepared(
        ConfigurableBootstrapContext bootstrapContext, ConfigurableEnvironment environment
    ) {
    }

    default void contextPrepared(ConfigurableApplicationContext context) {

    }

    default void contextLoaded(ConfigurableApplicationContext context) {
    }

    default void started(ConfigurableApplicationContext context, Duration timeTaken) {
    }

    default void ready(ConfigurableApplicationContext context, Duration timeTaken) {
    }

    default void running(ConfigurableApplicationContext context) {
    }

    default void failed(ConfigurableApplicationContext context, Throwable throwable) {
    }

}
